<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" type="text/css" href="../css/reset.css">
    <link rel="stylesheet" type="text/css" href="../css/result.css">
    <script type="text/javascript" src='../js/adaptive.js'></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/1.8.0/jquery-1.8.0.js"></script>
    <script src=""></script>
    <title>答题</title>
</head>
<style>
    .resultImg .rightNum{
        top: 1.4rem;
    }
    .level1{
      display:block;
    }
</style>
<body>
     <div class="resultPage">
      <img src="../images/fail.png" alt="" class="level1">
        <div class="fixedImg">
          <div class="resultImg">
              <!-- <img src="../images/fail.jpg" alt=""> -->
              <p class="rightNum">17</p>
          </div>
          <div class="resultText">
                <p>尊敬的<span class="resultName">xxx</span>，您答对了 <span class="rightNum2">17</span> /20题，花费了<span class="minitus">3</span>分<span class="second">20</span>秒，很遗憾闯关失败，你还需要继续学习哦～</p>  
          </div>
          <p class="startBtn">
                  <a class="restart">
                          重新学习
                   </a>
              </p>
            <p class="support">技术支持：武汉纺友技术有限公司</p>
          </div>
    </div>
    <script>
        window.onload =function(){
           var param = window.location.href.split('?')[1]
           var count,totalCount,id;
           param =param.split('&');
           count =param[0].split('=')[1]
           totalCount= param[1].split('=')[1]
           id= param[2].split('=')[1]
           console.log(count,totalCount);
           $('.rightNum').html(count)
           $('.rightNum2').html(count)
            totalMin =parseInt((totalCount)/60)
            totalSec =parseInt(totalCount  -totalMin*60)
           $('.minitus').html(totalMin)
           $('.second').html(totalSec)
           //大于10道题目  样式微调
           if(count>=10){
               $('.rightNum').css('transform','translateX(-0.8rem)')
           };
           $('.restart').click(function(){
               if(id==20){
                   id=1
               }else if(id==40){
                 id=21
               }
               window.location ='question.html?id='+id
           });
           //取回cookie
		 function getCookie(c_name) {
            if (document.cookie.length>0){
            c_start=document.cookie.indexOf(c_name + "=")
            if (c_start!=-1)
                { 
                c_start=c_start + c_name.length+1 
                c_end=document.cookie.indexOf(";",c_start)
                if (c_end==-1) c_end=document.cookie.length
                return unescape(document.cookie.substring(c_start,c_end))
                } 
            }
            return ""
            }
            $('.resultName').html(getCookie('name'))
        }
    </script>
</body>
</html>